package com.longxi.tianjintianbao.ui.activity.repair_publish;

import android.support.v7.widget.RecyclerView;

import com.longxi.tianjintianbao.R;
import com.longxi.tianjintianbao.ui.base.BaseActivity;
import com.longxi.tianjintianbao.ui.presenter.repair_publish.SelectCommunityAtPresenter;
import com.longxi.tianjintianbao.ui.view.repair_publish.ISelectCommunityAtView;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;

public class SelectCommunityActivity extends BaseActivity<ISelectCommunityAtView, SelectCommunityAtPresenter> implements ISelectCommunityAtView {

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_general_list;
    }

    @Override
    public void initData() {
        super.initData();
        mPresenter.setBar();
        mPresenter.initAdapter();
        mPresenter.getCommunity();
    }

    @Override
    public void initListener() {
        super.initListener();
        mTvRight.setOnClickListener(v -> mPresenter.saveUserBuild());
    }

    @Override
    protected SelectCommunityAtPresenter createPresenter() {
        return new SelectCommunityAtPresenter(this);
    }

    @Override
    public SmartRefreshLayout getRefreshLayout() {
        return mRefreshLayout;
    }

    @Override
    public RecyclerView getRvContent() {
        return mRvContent;
    }

    @Override
    protected void onDestroy() {
        mPresenter.onDestroy();
        super.onDestroy();
    }
}
